﻿<?php
include_once "../../lib/init.php";

//echo __DIR__;
//echo ROOT;
$mySqlHelper = new MySqlHelper();
/*
$sql='select * from tx_user order by id';
$res = $mySqlHelper->getRowsArray($sql);
$pageSize=3;
$rowCount=0;
$pageNow =1;
//$_GET[];
$pageCount = 0;

$res=$mySqlHelper->getFetchRow($sql);
if ($res1=$mySqlHelper->getFetchRow($sql)){
    $rowCount=$res1[0];
}
*/
//统计多少条数据
$sqlpage = "select count(*) from tx_user";
$num=$mySqlHelper->mGetOne($sqlpage)[0];
//GET过来的是否为空，为空显示第一页，不为空则显示GET页
$curr=isset($_GET['page'])?$_GET['page']:1;
//一页显示多少条
$cnt=10;
//调用计算页面
$page=getPage($num,$curr,$cnt);

//计算共有多少页
$sql1="select * from tx_user limit ".($curr-1)*$cnt.",".$cnt;
$res = $mySqlHelper->getRowsArray($sql1);

require_once ROOT."/view/admin/user_list.html";